//某职业考试的时间是每月倒数第二个周六上午8点，输出今年的考试时间
//用yyyy/MM/dd hh时 的格式输出

import java.time.LocalDate;
import java.time.DayOfWeek;
import java.time.format.DateTimeFormatter;

public class ExamSchedule {
    public static void main(String[] args) {
        // 获取当前年份
        int year = LocalDate.now().getYear();

        // 设置日期格式
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd HH时");

        // 输出今年的考试时间
        System.out.println("今年的考试时间：");
        for (int month = 1; month <= 12; month++) {
            LocalDate examDate = findSecondLastSaturday(year, month);
            System.out.println(formatter.format(examDate.atTime(8, 0)));
        }
    }

    // 方法计算某月的倒数第二个周六
    private static LocalDate findSecondLastSaturday(int year, int month) {
        LocalDate lastDayOfMonth = LocalDate.of(year, month, 1).withDayOfMonth(LocalDate.of(year, month, 1).lengthOfMonth());

        // 找到该月最后一个周六
        LocalDate lastSaturday = lastDayOfMonth.with(DayOfWeek.SATURDAY);

        // 返回倒数第二个周六
        return lastSaturday.minusWeeks(1);
    }
}
